<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绝对定位</title>
    <style>
        .grandfather {
            position: relative;
            width: 400px;
            height: 400px;
            background-color: deeppink;
        }

        .father {
            /* position: relative; */
            width: 300px;
            height: 300px;
            background-color: skyblue;
        }

        .son {
            position: absolute;
            bottom: 0;
            right: 0;
            width: 200px;
            height: 200px;
            background-color: pink;
        }
    </style>
</head>

<body>
    绝对定位的特点：
    <ol>
        <li>如果没有祖先元素或者祖先元素没有定位，则以浏览器为准定位（Document文档）</li>
        <li>如果祖先元素有定位（相对、绝对、固定定位），则以最近一级的有定位的祖先元素为参考点移动位置</li>
        <li>绝对定位不在占有原先的位置。（脱标）</li>
    </ol>
    <div class="grandfather">
        <div class="father">
            <div class="son"></div>
        </div>
    </div>
</body>

</html>